# -*- coding: UTF-8 -*-

import time
from selenium import webdriver
from selenium.webdriver.common.by import By

chromedriver_linux_path = '/home/ted/workspace/tools/chromedriver'
chromedriver_win32_path = 'C:\\Users\\ted\\AppData\\Local\\Google\\Chrome\\Application\\chromedriver.exe'

WEBSITE = "https://www.pokemon.cn"
URL = "https://www.pokemon.cn/play/pokedex/"
IMG_PATH = "apps/pokemon/img/"


def main():
	# print(chromedriver_linux_path)

	driver = webdriver.Chrome()
	# time.sleep(1)

	print(URL)
	driver.get(URL)

	driver.implicitly_wait(0.5)

	# element = driver.find_elements(By.CLASS_NAME, 'pokemon-search__form--input')
	# for sub_element in element:
	# 	sub_element.send_keys('0002')
		# time.sleep(1)

	# element = driver.find_elements(By.CLASS_NAME, 'pokemon-search__form--button')
	# for sub_element in element:
	# 	sub_element.click()
		# time.sleep(1)

	element = driver.find_element(By.XPATH, "//*[starts-with(@class,'pokemon-list--box__no')]")
	element = driver.find_element(By.XPATH, "//div[3]/div[2]//*[starts-with(@src, '/play/resources/pokedex/img/pm')]")

	input()
	driver.quit()


if __name__ == '__main__':
	main()

